package com.bjpowernode.money;

import java.io.Serializable;
/*
    分页模型，用于进行分页的
 */
public class PageModel implements Serializable {

    private Integer firstPage = 1;
    private Integer pageSize = 10;  //每页记录数
    private Long cunPage;
    private Long totalCount;
    private Long totalPage; //总页数

    public PageModel() {
    }

    public PageModel(Integer firstPage, Integer pageSize) {
        this.firstPage = firstPage;
        this.pageSize = pageSize;
    }
    public PageModel(Integer pageSize) {
        this.pageSize = pageSize;
    }


    public Integer getFirstPage() {
        return firstPage;
    }

    public void setFirstPage(Integer firstPage) {
        this.firstPage = firstPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Long getCunPage() {
        return cunPage;
    }

    public void setCunPage(Long cunPage) {
        this.cunPage = cunPage;
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    //总页数是算出来的 三目运算法
    public Long getTotalPage() {
        return totalPage=totalCount%pageSize>0?totalCount/pageSize+1:totalCount/pageSize;
    }


}
